package cn.new7as.cas5s.anhjkfu;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.lxj.xpopup.core.BasePopupView;
import com.lxj.xpopup.core.CenterPopupView;
import com.lxj.xpopup.util.XPopupUtils;

import cn.new7as.cas5s.R;
import cn.new7as.cas5s.tool.util.SharePreferenceUtils;

public class RequestPerPop extends CenterPopupView {



    public RequestPerPop(@NonNull Context context) {
        super(context);
    }

    @Override
    protected int getImplLayoutId() {
        return R.layout.pop_per_request;
    }

    @Override
    protected void onCreate() {
        super.onCreate();

        TextView extend = findViewById(R.id.extend);

        extend.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
                new SharePreferenceUtils(getContext()).putBoolean("notfirst",true);
            }
        });

        TextView settle = findViewById(R.id.settle);


        settle.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
                xPopupCallback.onConfirm("");
            }
        });



    }
    OnConfirmListener xPopupCallback;
    public BasePopupView setPopupCallback(OnConfirmListener xPopupCallback) {
        this.xPopupCallback = xPopupCallback;

        return this;
    }


    @Override
    protected void onShow() {
        super.onShow();

    }




    @Override
    protected int getMaxHeight() {
        return (int) (XPopupUtils.getScreenHeight(getContext()) * .7f);
    }
}